Node-RED block in Snap4City Microservice library node-red-contrib-snap4city-user is "switch-button">

With this node you can add a button to an existing dashboard or a new one created by the node. If this button is switched on "On Value", it outputs a message from the top output, if the button is switched on "Off Value", it outputs a message from the bottom output.

Configuration

dashboard string
Dashboard title to which the button will be added
widget string
Title that will have the widget containing the button.

Inputs

As payload one of these values (1, "on", true) to set the switch button to "ON" or one of these values (0, "off", false) to set the switch button to "OFF"

Outputs

  1. On Value
    Returns the on value when the button is switched on "ON"
  2. Off Value
    Returns the off value when the button is switched on "OFF"